#include "Python.h"  //<python2.5/Python.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>

#include "proc/readproc.h"
#include "proc/sysinfo.h"
#include "proc/devname.h"
#include "proc/whattime.h"

#include "procpsver.h"

#define BSIZE 4095

#define PROCT_DOC "The dictionary contains following keys:\n\
        \"tid\" => task id, the POSIX thread ID (see also: tgid)\n\
       \"ppid\" => pid of parent process\n\
       \"pcpu\" => \%CPU usage (see also pcpustr)\n\
      \"state\" => single-char code for process state (S=sleeping)\n\
      \"utime\" => user-mode CPU time accumulated by process\n\
      \"stime\" => kernel-mode CPU time accumulated by process\n\
     \"cutime\" => cumulative utime of process and reaped children\n\
     \"cstime\" => cumulative stime of process and reaped children\n\
 \"start_time\" => start time of process -- seconds since 1-1-70\n\
      \"euser\" => effective user name\n\
      \"ruser\" => real user name\n\
      \"suser\" => saved user name\n\
      \"fuser\" => filesystem user name\n\
     \"egroup\" => effective group name\n\
     \"rgroup\" => real group name\n\
     \"sgroup\" => saved group name\n\
     \"fgroup\" => filesystem group name\n\
        \"cmd\" => basename of executable file in call to exec(2)\n\
       \"pgrp\" => process group ID\n\
    \"session\" => session ID\n\
       \"nlwp\" => number of threads, or 0 if no clue\n\
       \"tgid\" => task group ID, the POSIX PID (see also: tid)\n\
        \"tty\" => full device number of controlling terminal\n\
                 (see also: devnam)\n\
       \"euid\" => effective user ID\n\
       \"egid\" => effective group ID\n\
       \"ruid\" => real user ID\n\
       \"rgid\" => real group ID\n\
       \"suid\" => saved user ID\n\
      \"tpgid\" => terminal process group ID\n\
\"exit_signal\" => might not be SIGCHLD\n\
  \"processor\" => current (or most recent?) CPU\n\
    \"environ\" => dictionary of environ variables\n\
\n\
 Procpy specific dictionary keys:\n\
    \"pcpustr\" => \%CPU usage in #.## format (see also: pcpu)\n\
    \"pmemstr\" => \%MEM usage in #.## format\n\
     \"ttynam\" => name of controlling terminal\n\
    \"cmdline\" => full argv of the process as a tuple\n\
      \"start\" => start time of process as a tuple:\n\
                 (year, month, day, hour, min, sec, wday, yday, isdst)\n\
       \"time\" => accumulated cpu, user and system time as a tuple: (min, sec)\n\
\n\
NOTE: keys description is almost a copy of proc_t struct description\n\
      from readline.h file (procps/proc/readline.h)"
